package com.yang.provider.manager;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yang.provider.entity.Product;
import com.yang.provider.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

/**
 * @author ：YangRan
 * @date ：Created in 2021/10/30 19:20
 * @description：商品dao管理类
 * @modified By：
 * @version: 1.0
 */
@Component
public class ProductManager extends ServiceImpl<ProductMapper, Product> {


    @Autowired
    private ProductMapper productMapper;

    @Cacheable(value="productCache", key="#id")
    public Product queryById(Long id) {
        return productMapper.selectById(id);
    }

}
